package com.ft.oa.web.presalesController;

import com.ft.oa.domain.dto.ApiResult;
import com.ft.oa.domain.technology.TechnologyContributor;
import com.ft.oa.mapper.technologyMapper.ItechnologyContributorMapper;
import com.ft.oa.service.technologyService.IContributorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/tContributor")
public class TContributorController {
    @Autowired
    private IContributorService iContributorService;
    /**
     * 点击参与人 获取参与人信息
     */
    @RequestMapping("/contributorList")
    private ApiResult contributorList(@RequestParam int industryid){
        HashMap<String,Object> contributorsMap = new HashMap<>();
        contributorsMap.put("contributorList",iContributorService.contributorList(industryid));
        return ApiResult.builder().code(200).msg("技术参与人返回成功").data(contributorsMap).build();
    }
    /**
     * 新增参与人
     */
    @RequestMapping("/addpeople")
    private ApiResult addpeople(@RequestBody TechnologyContributor itechnologyContributor){
        return ApiResult.builder().code(200).msg("新增技术参与人").data(iContributorService.addpeople(itechnologyContributor)).build();
    }
    /**
     * 删除行业参与人
     */
    @GetMapping("/dellContributor")
    public ApiResult dellContributor(@RequestParam int peopleid){
        return ApiResult.builder().code(200).msg("技术参与人删除成功").data(iContributorService.dellContributor(peopleid)).build();
    }
}
